// DriveNotes. Copyright (c) 2011, Andrei Senchuk. All rights reserved.
package net.taviscaron.drivenotes.server.service.endpoint;

import java.util.List;
import javax.jws.WebMethod;
import javax.jws.WebService;
import net.taviscaron.drivenotes.shared.exceptions.InvalidEntityException;
import net.taviscaron.drivenotes.shared.model.entity.Place;
import net.taviscaron.drivenotes.shared.model.entity.User;
import net.taviscaron.drivenotes.shared.service.PlaceService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Place servi
 * @author Andrei Senchuk
 */
@WebService(serviceName = "PlaceService")
public class PlaceServiceEndpoint implements PlaceService {
    @Autowired
    private PlaceService placeService;

    @WebMethod
    public List<Place> findPlacesByUser(User user) {
        return placeService.findPlacesByUser(user);
    }

    @WebMethod
    public Place findPlace(Long id, User author) {
        return placeService.findPlace(id, author);
    }

    @WebMethod
    public void savePlace(Place place) throws InvalidEntityException {
        placeService.savePlace(place);
    }

    @WebMethod
    public void removePlaceById(Long id) {
        placeService.removePlaceById(id);
    }
}
